package com.zhangdi.dwdata.entity;

import com.zhangdi.dwdata.listener.EntityListener;

import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by zhangdi on 2020/08/25 16:55:45.
 */
@EntityListeners({EntityListener.class})
@MappedSuperclass
public class BaseEntity extends LongEntity implements Serializable {
    private Date addDate;
    private Date lastDate;

    public BaseEntity() {
        this.inittime();
    }

    private void inittime() {
        this.addDate = new Date();
        this.lastDate = new Date();
    }

    public Date getAddDate() {
        return addDate;
    }

    public void setAddDate(Date addDate) {
        this.addDate = addDate;
    }

    public Date getLastDate() {
        return lastDate;
    }

    public void setLastDate(Date lastDate) {
        this.lastDate = lastDate;
    }
}
